package common.consts;

/**
 * Created by aceyin on 15/6/29.
 */
public interface Offers {

    static boolean isRated(String status) {
        if (status == null) {
            return false;
        }
        return RateResult.EGG.name().equalsIgnoreCase(status) || RateResult.FLOWER.name().equalsIgnoreCase(status);
    }

    static boolean isCanceled(String status) {
        if (status == null) {
            return false;
        }
        return Status.CANCELED.name().equalsIgnoreCase(status);
    }

    static boolean isEmployed(String status) {
        if (status == null) {
            return false;
        }
        return Status.EMPLOYED.name().equalsIgnoreCase(status);
    }

    static boolean isWaiting(String status) {
        if (status == null) {
            return false;
        }
        return Status.WAITING.name().equalsIgnoreCase(status);
    }

    static boolean isPayed(String payResult) {
        if (payResult == null) {
            return false;
        }
        return PayResult.PAYED.name().equalsIgnoreCase(payResult);
    }

    /**
     * 工作申请状态
     */
    enum Status {
        /* 等待录用 */
        WAITING,
        /* 已录用 */
        EMPLOYED,
        /* 已取消（备招聘方取消） */
        CANCELED
    }

    /**
     * 支付结果
     */
    enum PayResult {
        /* 未支付 */
        UN_PAYED,
        /* 已支付 */
        PAYED,
        /* 支付失败 */
        PAY_FAILED,
        /* 拒付 */
        WITHHOLD
    }

    /**
     * 评论结果
     */
    enum RateResult {
        UN_RATE,
        FLOWER,
        EGG
    }
}
